package com.hc.race;


import com.hc.race.entity.Challenges;
import com.hc.race.entity.Progress;
import com.hc.race.service.ChallengeService;
import com.hc.race.service.ProgressService;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import java.util.List;

/**
 * @Author zy
 * @Date 2023/11/25 12:16
 * @PackageName:com.hc.race
 * @ClassName: test
 * @Description: TODO
 * @Version 1.0
 */

@SpringBootTest
@Slf4j
@RunWith(SpringRunner.class)
public class test {

    @Autowired
    private ChallengeService challengeService;

    @Autowired
    private ProgressService progressService;

    @Test
    public  void test01(){
        Challenges singleInfo = challengeService.getSingleInfo(1L);
        System.out.println(singleInfo);
    }

    @Test
    public  void test02(){
        List<Challenges> info = challengeService.getInfo(1L);
        System.out.println(info);
    }

    @Test
    public  void test03(){
        Progress progress= Progress.builder()
                .taskId(1L)
                .id(3L)
                .percentage(100)
                .number(50L)
                .userId(1L)
                .createTime(LocalDateTime.now())
                .day(3)
                .build();
        progressService.success(progress);
    }



    @Test
    public void test04(){
        progressService.sendEmailToFriend(1L,1L,1L);
    }

    @Test
    public void test05(){
    progressService.getDayInfo(1L,1L);
    }

    @Test
    public void test06(){
        Progress progress= Progress.builder()
                .taskId(1L)
                .percentage(98)
                .number(50L)
                .userId(1L)
                .createTime(LocalDateTime.now())
                .day(110)
                .build();
        progressService.temp(progress);
    }
}
